package com.example.imoocmusicdemo.activity;


import android.content.Intent;
import android.os.Bundle;

import com.example.imoocmusicdemo.R;

import java.util.Timer;
import java.util.TimerTask;

//1.延迟三秒
//2.转跳页面
public class WelcomeActivity extends BaseActivity {

    private Timer timer;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        
        init();
    }

    /**
     * 初始化 ，延迟3秒
     */
    private void init() {
        timer=new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                //oMain();
                toLogin();
            }
        },3*1000);
    }

    /**
     * 跳转到主页面
      */
  /*  private void toMain(){
        Intent intent=new Intent(this,MainActivity.class);
        startActivity(intent);
    }*/

    /**
     * 跳转Login登录页面
     */
    private void toLogin(){
        Intent intent=new Intent(this,LoginActivity.class);
        startActivity(intent);
    }

}
